package com.mxchip.livestar.base

import android.content.Context
import android.widget.Toast
import androidx.fragment.app.Fragment
import com.mxchip.livestar.Appli
import java.security.AccessController.getContext

fun Context.toast(message: CharSequence) =
        Toast.makeText(this, message, Toast.LENGTH_SHORT).show()


fun Fragment.toast(message: CharSequence) = if (this.context != null)
    Toast.makeText(this.context, message, Toast.LENGTH_SHORT).show() else {
        Toast.makeText(requireContext(), message, Toast.LENGTH_SHORT).show()
}